package com.itheima.reggie;

import com.github.wxpay.sdk.WXPay;
import com.itheima.reggie.config.MyConfig;

import java.util.HashMap;
import java.util.Map;

public class Demo {
    public static void main(String[] args) throws Exception {
        MyConfig mc = new MyConfig();
        WXPay wxPay = new WXPay(mc);//wxPay核心支付类
        HashMap<String, String> map = new HashMap<>();
        //封装请求参数
        map.put("body","红烧肉套餐");//商品描述
        map.put("out_trade_no","1478646850276188160");//商品描述
        map.put("total_fee","1");//商品描述  1分钱
        map.put("spbill_create_ip","127.0.0.1");//服务器地址
        map.put("notify_url","http://www.baidu.com");//
        map.put("trade_type","NATIVE");//支付方式
        //发送请求
        Map<String, String> reponseMap = wxPay.unifiedOrder(map);
        System.out.println(reponseMap);
    }
}
